function t(t, n, o) {
    return n in t ? Object.defineProperty(t, n, {
        value: o,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : t[n] = o, t;
}

var n, o = require("../export.js");

getApp();

Page((n = {
    data: {
        CarList: [],
        index: 0,
        date: "",
        region: [],
        reg: 0
    },
    onLoad: function(t) {
        console.log(t), this.getCarList(t), this.getExplain(t);
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    formSubmit: function(t) {
        console.log(t);
    },
    getCarList: function(t) {
        var n = this;
        o.requestUtil.post(o._DuoguanData.duoguan_host_api_url + "/index.php/addon/DuoguanCar/Api/getCarList.html", t, function(t) {
            n.setData({
                CarList: t
            });
        }), console.log(this.data);
    },
    bindPickerChange: function(t) {
        var n = t.detail.value;
        this.setData({
            index: n
        });
    }
}, t(n, "formSubmit", function(t) {
    var n = this, a = t.detail.value;
    a.car_goods_id = this.data.CarList[this.data.index].id;
    var i = a;
    console.log(this.data), this.setData({
        submitIsLoading: !0,
        buttonIsDisabled: !0
    }), o.requestUtil.post(o._DuoguanData.duoguan_host_api_url + "/index.php/addon/DuoguanCar/Apiform/loan.html", i, function(t) {
        console.log(t), n.loan(t);
    }, this, {
        isShowLoading: !1,
        completeAfter: function(t) {
            this.setData({
                submitIsLoading: !1,
                buttonIsDisabled: !1
            });
        }
    });
}), t(n, "loan", function(t) {
    this.setData({
        submitIsLoading: !1,
        buttonIsDisabled: !1
    }), wx.showModal({
        title: "提示",
        content: t.info,
        showCancel: !1,
        complete: function(t) {
            wx.navigateTo({
                url: "/pages/car/index/index",
                fail: function(t) {
                    wx.switchTab({
                        url: "/pages/car/index/index"
                    });
                }
            });
        }
    });
}), t(n, "getExplain", function(t) {
    var n = this;
    o.requestUtil.post(o._DuoguanData.duoguan_host_api_url + "/index.php/addon/DuoguanCar/Api/getExplain.html", t, function(t) {
        console.log(t), n.setData({
            Explain: t.explain,
            coupon: t.coupon,
            Exlength: t.explain.daikuan_explain.length
        });
    });
}), t(n, "bindRegionChange", function(t) {
    this.setData({
        region: t.detail.value,
        reg: 1
    });
}), t(n, "goCoupon", function() {
    wx.navigateTo({
        url: "/pages/car/get-coupon/get-coupon"
    });
}), n));